const express = require("express");
const bodyParser = require("body-parser");
const app = express();

app.use(express.static(__dirname + "/public"));
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(bodyParser.text());

app.get("/test", (req, res) => {
    console.log(req.query);
    res.send({ result: req.body });
});

app.post("/test", (req, res) => {
    console.log(req.body);
    res.send({ result: req.body });
});


app.listen(6000, function () {
    console.log("server listen on: http://localhost:6000");
});